rm(list = ls())

## Load the evalid functions from Github.  At time of acceptance, the repository was at commit
## `f4d81f0e8dfc58f6fca8e9e3ac272bb30470cc6d` which is loaded below.

if(!require(evalid)) {
  library(devtools)
  install_github("naoki-egami/evalid@f4d81f0e8dfc58f6fca8e9e3ac272bb30470cc6d", dependencies = TRUE)
}

library(evalid)

## Load packages
library(grf)
library(foreign)
library(lmtest)
library(sandwich)
library(survey)
library(MASS)
library(parallel)
library(estimatr)
library(bartCause)
library(tidyverse)
library(knitr)
library(kableExtra)
library(estimatr)
library(ri)
library(boot)

## Output system info
print(Sys.time())

start_time <- Sys.time()

print(sessionInfo())

## Number of simulations
nsim <- 1000

# Generate folders if they do not exist
if(!file.exists("./generated/appendix_2")) dir.create("./generated/appendix_2")
if(!file.exists("./generated/Figures")) dir.create("./generated/Figures")
if(!file.exists("./generated/Tables")) dir.create("./generated/Tables")